package com.auxgroup.smarthome.business.service.inner;

import com.auxgroup.smarthome.business.service.AppVersionInnerServiceFallback;
import com.auxgroup.smarthome.business.vo.AppVersionVo;
import com.auxgroup.smarthome.utils.PageContent;
import com.auxgroup.smarthome.web.ApiResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "INNER-SERVICE", fallback = AppVersionInnerServiceFallback.class)
public interface AppVersionInnerService {

    @GetMapping(value = "/inner/app_version")
    ApiResponse<AppVersionVo> getCurrentAppVersion();

    @GetMapping(value = "/inner/app_versions")
    ApiResponse<PageContent<AppVersionVo>> searchAppVersions(@RequestParam("page") Integer page, @RequestParam("size") Integer size, @RequestParam("keywords") String keywords, @RequestParam("createTimeSlot") String createTimeSlot);


    @PostMapping(value = "/inner/app_version")
    ApiResponse create(@RequestParam("version") String version,@RequestParam("build") Integer build,@RequestParam("link") String link,@RequestParam("name") String name,@RequestParam("description") String description);


    @PutMapping(value = "/inner/app_version/{appVersionId}")
    ApiResponse update(@RequestParam("appVersionId") String appVersionId,@RequestParam("version") String version,@RequestParam("build") Integer build,@RequestParam("link") String link,@RequestParam("name") String name,@RequestParam("description") String description);


    @DeleteMapping(value = "/inner/app_version/{appVersionId}")
    ApiResponse delete(@RequestParam("appVersionId")  String appVersionId);
}
